#include <pspkernel.h>
#include <pspdebug.h>
#include <oslib/oslib.h>
#include "objectdraw/objectdraw.h"
#include "controls.h"

PSP_MODULE_INFO("template", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main(int argc, char *argv[])
{
	oslInit(0);
	oslInitGfx(OSL_PF_5650,1);
	oslIntraFontInit(INTRAFONT_CACHE_MED);
	
	syscanvas = new DrawingCanvas(0,0,480,272);
	syscanvas->setFont(osl_sceFont);
	setupMenu();
	setupTextBox();
	currpage = Book_Selection;
	
	bool frame_skip = false;
	while(!osl_quit)
	{
		captureEvents();
		if(!frame_skip)
		{
			oslStartDrawing();
			syscanvas->redraw();
			oslEndDrawing();
		}
		frame_skip = oslSyncFrameEx(0,6,0);
	}
	
	sceKernelExitGame();
	return 0;
}
